import { defineComponent, isRef, unref } from 'vue';
import { Button, Space } from 'ant-design-vue';
import { omit } from 'lodash-es';

export default defineComponent({
  name: 'SchemaTable',
  props: {
    slotData: {
      type: Object,
      required: true,
    },
  },
  setup(props) {
    const { column } = props.slotData;
    const slotData = JSON.parse(JSON.stringify(props.slotData));
    return () => {
      return (
        <Space>
          {column?.actions(slotData).map((item) => (
            <Button
              class={item.class}
              {...omit(item, ['label', 'icon'])}
            >
              <i class={`iconfont ${item?.icon}`}></i>
              {item.label}
            </Button>
          ))}
        </Space>
      );
    };
  },
});
